{extend name='admin@public/content'}

{block name="content"}
<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" id="ProductForm" class='form-horizontal layui-form padding-top-20'>

    <div class="form-group">
        <label class="col-sm-2 control-label">banner标题</label>
        <div class='col-sm-8'>
            <input name="title" required value="{$vo.title|default=''}" class="layui-input" title="请输入banner标题" placeholder="请输入banner标题">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">跳转路径</label>
        <div class='col-sm-8'>
            <input name="url" required value="{$vo.url|default=''}" class="layui-input" title="请输入跳转路径" placeholder="请输入跳转路径">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label label-required">banner图片(720x400px)</label>
        <div class='col-sm-8'>
            <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                <tbody>
                <tr>
                    <td class="text-top" style="width:100px">
                        <input type="hidden" name="pic" value="{$vo.pic|default=''}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>


    <div class="hr-line-dashed"></div>

    <div class="col-sm-7 col-sm-offset-2">
        <div class="layui-form-item text-center">
            {if !empty($vo.id)}<input type="hidden" name="id" value="{$vo.id}">{/if}
            <button class="layui-btn" type="submit">提交</button>
            <button class="layui-btn layui-btn-danger" type='button' onclick="window.history.back()">取消</button>
        </div>
    </div>

</form>

<script>
    require(['jquery','angular'], function () {
        window.form.render();
        var app = angular.module("ProductForm", []).run(callback);
        angular.bootstrap(document.getElementById(app.name), [app.name]);

        function callback($rootScope) {
            // 单图片上传处理
            $('#ProductForm [name="pic"]').uploadOneImage();

        }
    });
</script>
{/block}

{block name="style"}
<style>

    .background-item {
        padding: 15px;
        background: #efefef;
    }

    .background-item thead tr {
        background: #e0e0e0
    }

    .price-input-td {
        padding: 0 !important;
    }

    .price-input-td:before {
        margin: 4px;
        width: 35px;
        height: 22px;
        content: "金额";
        line-height: 20px;
        text-align: center;
        position: absolute;
        background: #e2e2e2;
    }

    .price-input-td input {
        height: 30px;
        padding-left: 50px;
        border: none !important;
    }
</style>
{/block}